package com.cjl.learn.factory.simpleFactory.factory;

import com.cjl.learn.factory.simpleFactory.pizza.CheesePizza;
import com.cjl.learn.factory.simpleFactory.pizza.ChinaPizza;
import com.cjl.learn.factory.simpleFactory.pizza.GreekPizza;
import com.cjl.learn.factory.simpleFactory.pizza.Pizza;

/**
 * Created by Enzo Cotter on 2019-08-14.
 */
public class PizzaFactory {

    public Pizza createPizza(String type) {
        if ("greek".equals(type)) {
            return new GreekPizza(type);
        } else if ("cheese".equals(type)) {
            return new CheesePizza(type);
        } else if ("china".equals(type)) {
            return new ChinaPizza(type);
        }

        return null;
    }
}
